import request from '@/utils/request'

// 查询单据列表
export function listOrder(query) {
    return request({
        url: '/system/order/list',
        method: 'get',
        params: query
    })
}

// 查询单据列表
export function xjListOrder(query) {
    return request({
        url: '/system/order/xjList',
        method: 'get',
        params: query
    })
}

// 查询单据列表
export function cgList(query) {
    return request({
        url: '/system/order/cgList',
        method: 'get',
        params: query
    })
}

// 查询单据列表
export function sltzList(query) {
    return request({
        url: '/system/order/sltzList',
        method: 'get',
        params: query
    })
}

// 查询单据列表
export function cgrkOrder(query) {
    return request({
        url: '/system/order/cgrkOrder',
        method: 'get',
        params: query
    })
}

// 查询单据列表
export function tltzcxOrder(query) {
    return request({
        url: '/system/order/tltzcxOrder',
        method: 'get',
        params: query
    })
}

// 查询单据列表
export function cgtlcxlistOrder(query) {
    return request({
        url: '/system/order/cgtlcxOrder',
        method: 'get',
        params: query
    })
}

// 查询单据列表
export function bjListOrder(query) {
    return request({
        url: '/system/order/bjList',
        method: 'get',
        params: query
    })
}

// 查询单据详细
export function getOrder(id) {
    return request({
        url: '/system/order/' + id,
        method: 'get'
    })
}

// 新增单据
export function addOrder(data) {
    return request({
        url: '/system/order',
        method: 'post',
        data: data
    })
}

// 新增询价单据
export function addXJOrder(data) {
    return request({
        url: '/system/order/xjOrder',
        method: 'post',
        data: data
    })
}

// 新增报价单据
export function addBJOrder(data) {
    return request({
        url: '/system/order/bjOrder',
        method: 'post',
        data: data
    })
}

// 新增采购订单
export function purchaseOrder(data) {
    return request({
        url: '/system/order/purchaseOrder',
        method: 'post',
        data: data
    })
}

// 新增收料通知订单
export function addReceipt(data) {
    return request({
        url: '/system/order/addReceipt',
        method: 'post',
        data: data
    })
}

// 新增采购入库订单
export function warehousing(data) {
    return request({
        url: '/system/order/warehousing',
        method: 'post',
        data: data
    })
}

// 更新库存
export function addStock(data) {
    return request({
        url: '/system/order/addStock',
        method: 'post',
        data: data
    })
}

// 更新库存
export function updateStock(data) {
    return request({
        url: '/system/order/updateStock',
        method: 'post',
        data: data
    })
}

// 新增退料通知订单
export function returnMaterial(data) {
    return request({
        url: '/system/order/returnMaterial',
        method: 'post',
        data: data
    })
}

// 新增采购退料订单
export function addPurchaseReturn(data) {
    return request({
        url: '/system/order/addPurchaseReturn',
        method: 'post',
        data: data
    })
}

// 查看报价
export function searchQuote(data) {
    return request({
        url: '/system/order/searchQuote',
        method: 'get',
        params: data
    })
}

// 修改单据
export function updateOrder(data) {
    return request({
        url: '/system/order',
        method: 'put',
        data: data
    })
}

// 修改单据
export function updateAllOrder(data) {
    return request({
        url: '/system/order/allOrder',
        method: 'put',
        data: data
    })
}

// 删除单据
export function delOrder(id) {
    return request({
        url: '/system/order/' + id,
        method: 'delete'
    })
}

export function getEnterpriseList(query) {
    return request({
        url: '/system/order/getEnterpriseList',
        method: 'get',
        params: query
    })
}

export function getSupplierList(query) {
    return request({
        url: '/system/order/getSupplierList',
        method: 'get',
        params: query
    })
}

export function getEnterpriseView(query) {
    return request({
        url: '/system/order/getEnterpriseView',
        method: 'get',
        params: query
    })
}

export function getSupplierView(query) {
    return request({
        url: '/system/order/getSupplierView',
        method: 'get',
        params: query
    })
}
